package saas.consumer.service.remote;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @title: OmsBaseInfoFeignClient
 * @description: 从oms BaseInfo获取租户转换关系FeignClient
 * @author: guan.xin
 * @create: 2021-11-29 14:01
 * @since: JDK8
 */
@FeignClient(value = "${oms4.tenant.perception.ecs-baseinfo.service:app-ecs-baseinfo-service}", contextId = "tenantConversionRelationClient")
public interface OmsBaseInfoFeignClient {

    /**
     * 全量店铺查询中台租户&4.0租户
     *
     * @return
     */
    @PostMapping("/baseinfo/salesEntity/findAllShopSaasInfo")
    JSONObject findAllShopSaasInfo();

    /**
     * 根据店铺编码查询中台租户&4.0租户
     *
     * @param shopCode
     * @return
     */
    @PostMapping("/baseinfo/salesEntity/findSaasInfoByShopCode")
    JSONObject findSaasInfoByShopCode(@RequestParam("shopCode") String shopCode);

    /**
     * 根据内部店铺编码查询中台租户&4.0租户
     *
     * @param innerShopCode
     * @return
     */
    @PostMapping("/baseinfo/salesEntity/findSaasInfoByInnerShopCode")
    JSONObject findSaasInfoByInnerShopCode(@RequestParam("innerShopCode") String innerShopCode);

    /**
     * 全量库存主体查询中台租户&4.0租户
     *
     * @return
     */
    @PostMapping("/baseinfo/ownerStockSubject/findAllOwnerStockSaasInfo")
    JSONObject findAllOwnerStockSaasInfo();

    /**
     * 根据库存主体编码查询中台租户&4.0租户
     *
     * @param ownerCode
     * @return
     */
    @PostMapping("/baseinfo/ownerStockSubject/findSaasInfoByOwnerCode")
    JSONObject findSaasInfoByOwnerCode(@RequestParam("ownerCode") String ownerCode);
}
